Skip to content
This repository was archived by the owner on Jan 10, 2023. It is now read-only.

contribution from 0xlock#2

Open
0xlock wants to merge 5 commits intocapofficial:mainfrom
0xlock:0xlock
Open

contribution from 0xlock#2
0xlock wants to merge 5 commits intocapofficial:mainfrom
0xlock:0xlock

Conversation

@0xlock
Copy link

@0xlock 0xlock commented Dec 22, 2022

  • If submitOrder margin exceeds freeMargin, set it to the max freeMargin available
  • Add depositThroughUniswap
  • Add addLiquidityThroughUniswap

@0xlock 0xlock marked this pull request as draft December 22, 2022 13:55
uint256 lockedMargin = store.getLockedMargin(user);

if (int256(lockedMargin + params.margin) > equity) {
params.margin = uint256(equity - int256(lockedMargin));
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, but here size must also be adjusted so leverage stays consistent. @0xlock

@0xlock 0xlock marked this pull request as ready for review December 23, 2022 15:55
@0xlock 0xlock requested a review from kappacappa December 23, 2022 15:55
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants